<%-- 
    Document   : paymentConfirmation
    Created on : 2 juin 2012, 03:21:55
    Author     : isen
--%>

<%@page import="model.Transactions"%>
<%@page import="persistence.PersistenceInterface"%>
<%@page import="persistence.PersistenceFactory"%>
<%@page import="persistence.PersistenceImplementation"%>
<%@page import="model.CartContent"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Payment Confirmation</title>
    </head>
    <body>


        <% String clientname = (String) request.getSession().getAttribute("user");
            int cartid = PersistenceImplementation.getJDBCPersistenceManager().getCurrentCartId(clientname);
            double finalprice = PersistenceImplementation.getJDBCPersistenceManager().getFinalPrice(cartid);     
    %>


    <center>
        <h1>Congratulations your payment is done.</h1><br />
        <%if(PersistenceImplementation.getJDBCPersistenceManager().createTransaction(cartid, clientname, finalprice)){
            int transactionID = PersistenceImplementation.getJDBCPersistenceManager().getTransactionID(cartid);
             PersistenceImplementation.getJDBCPersistenceManager().setPaid(cartid);%>
             
             <h1>The ID of your transaction is: <%=transactionID%></h1><br />
        
        <%}%>
        
        <%@include file="/WEB-INF/include/menuClient.jsp" %>
    </center>



</body>
</html>
